#include "stdafx.h"

#include "TextOutput.h"

CFontManager * CFontManager::_inst = 0;
/*
void CFontManager::print_line_at(char* str, size_t sz_text, int x, int y)
{
	const CRect& scr = CRenderer::getInstance()->getScreen();
	float rx = (((float)x / (float)scr.w) * 2.0f) - 1.0f;
	float ry = (((float)y / (float)scr.h) * 2.0f) + 1.0f;
	glRasterPos2f(rx, ry);
	glCallLists((GLsizei)sz_text, GL_UNSIGNED_BYTE, str);
}
*/
void CFontManager::print_line_at(char* str, size_t sz_text, float fx, float fy)
{
	glRasterPos2f(fx, fy);
/*
	CFontManager::getDefaultFont()

	char * d = new char[sz_text];
	memcpy(d, str, sz_text);
	for (int i = 0; i < sz_text; i++)
		d[i] += 3;
	glCallLists((GLsizei)sz_text, GL_UNSIGNED_BYTE, d);
	*/
	glCallLists((GLsizei)sz_text, GL_UNSIGNED_BYTE, str);
}
void CFontManager::print_line_at(char* str, size_t sz_text, float fx, float fy, float fz)
{
	glRasterPos3f(fx, fy, fz);
	glCallLists((GLsizei)sz_text, GL_UNSIGNED_BYTE, str);
}